package com.kun.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @descriptions: 拦截器
 * @author: SunKun
 * @date: 2021/7/7 0007 14:09
 * @version: 1.0
 */
@Configuration
public class WebConfigurer implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册TestInterceptor拦截器
//        InterceptorRegistration registration = registry.addInterceptor(new AdminInterceptor());
//        registration.addPathPatterns("/**"); //所有路径都被拦截
//        registration.excludePathPatterns(    //添加不拦截路径
//                "/kun/admin/blogger/signIn",//博主登录
//                "/kun/foreign/user/signIn", //用户登录
//                "/**/*.html", //html静态资源
//                "/**/*.js",   //js静态资源
//                "/**/*.css",  //css静态资源
//                "/**/*.woff",
//                "/**/*.ttf",
//                "/kun/admin/blogger/logout"
//        );
    }
}
